<template>
  <v-ons-page>
    <v-ons-toolbar>
      <div class="left">
        <v-ons-back-button>返回</v-ons-back-button>
      </div>
      <div class="center">地址管理</div>
    </v-ons-toolbar>
    <div class="container">
      <div class="data-list">
        <div class="data-item">
          <div class="address-info">
            <v-ons-radio class="address-radio" value="1" v-model="selectedVegetable"></v-ons-radio>
            <div>
              <p>南轲洋(12345678912)</p>
              <p>陕西省西安市新城区西安地区</p>
            </div>
          </div>
          <div class="select-status">
            <div>
              <button class='checked-btn' @click="enterPage({path: selectToPageEditor ? '/' : '/ConsumerEditorAddress'})">编辑</button>
            </div>
            <div>
              <button class='del-btn'>删除</button>
            </div>
          </div>
        </div>

        <div class="data-item"
             @click="enterPage({path: selectToPageEditor ? '/' : '/ConsumerEditorAddress'})">
          <!-- 添加 -->
          <div class="address-info">
            <img
              src="../../assets/resource/consumer/bank_card/add-icon.png"
              alt="" class='add-address-icon'>
            <div class="add-address">
              添加地址
            </div>
          </div>
        </div>
      </div>
    </div>
  </v-ons-page>
</template>

<script>
  export default {
    data() {
      return {
        selectToPageEditor: false,
        selectedVegetable: '1'
      }
    },
    methods: {
      enterPage({path: path, actionSheet: actionSheet}) {
        if (actionSheet) {
          this.actionSheetVisible = false
        }
        this.$router.push({
          path: path
        });
      }
    },
    mounted() {
      let select = this.$route.params.select;
      if (select == 1) {
        this.selectToPageEditor = true;
      }
    }
  }
</script>

<style scoped lang="less">
  @import "../../assets/less/consumer/address-management.less";
</style>
